//strcpy模拟实现

#include <iostream>
#include <assert.h>

char* strcpy_self(char* destination, const char* source)
{
    assert(destination != nullptr && source != nullptr);
    char* start = destination;
    while(*destination++ = *source++); // 当while('\0')结束循环
    return start;
}

int main()
{
    char dest[] = "xxxxxxxxxxx";
    char res[] = "hello";
    printf("%s\n", strcpy_self(dest, res));

    return 0;
}

